package com.yisu.springboot.controller;

import com.yisu.springboot.publisher.RedisMessagePublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xuyisu
 * @description 样例
 */
@RestController
public class ExampleController {

    @Autowired
    private RedisMessagePublisher publisher;

    @GetMapping("/publisher")
    public String hello(@RequestParam("context") String context){
        publisher.publish("myChannel",context);
        return "success";
    }
}
